package models

import "time"

// ChangeLog 变更日志表
type ChangeLog struct {
	ID         uint      `gorm:"primaryKey;autoIncrement"`
	DocumentID uint      `gorm:"not null;index"`
	Document   Document  `gorm:"foreignKey:DocumentID"`
	UserID     uint      `gorm:"not null;index"`
	User       User      `gorm:"foreignKey:UserID"`
	Step       int       `gorm:"not null;check:step >= 0 AND step <= 3"`
	Before     string    `gorm:"type:text"`
	After      string    `gorm:"type:text"`
	CreatedAt  time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`
}
